{extend name='admin@main'}

{block name="button"}
{if auth("admin/charge_active/activeAdd")}
<button data-open='{:url("activeAdd")}' data-title="添加活动" class='layui-btn layui-btn-sm layui-btn-primary'>添加活动</button>
{/if}
{/block}

{block name="content"}
<style type="text/css">
    .explanation {
        color: #2CBCA3;
        background-color: #EDFBF8;
        display: block;
        width: 99%;
        height: 100%;
        padding: 6px 9px;
        border-radius: 5px;
        position: relative;
        overflow: hidden;
    }
</style>
<div class="think-box-shadow">
    {include file='charge_active/search/index_search'}
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">说明：</h4>
            <span id="explanationZoom" title="收起提示"></span> </div>
        <ul>
            <li style="color: red;">充值活动只获取最新一条活动</li>
        </ul>
    </div>
    <br>
    <table class="layui-table margin-top-10" lay-skin="line">
        <thead>
            <tr>
                <th>活动ID</th>
                <th>活动标题</th>
                <th>兑换比例</th>
                <th>充值送发布豆</th>
                <th>充值送积分</th>
                <th>是否启用</th>
                <th>开始时间</th>
                <th>到期时间</th>
                <th>添加时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.name}</td>
            <td>{$vo.publish_bean}</td>
            <td>{$vo.charge_bean}</td>
            <td>{$vo.charge_credit}</td>
            <td>{eq name='vo.status' value='0'}<span class="layui-badge">否</span>{else}<span class="layui-badge layui-bg-green">是</span>{/eq}</td>
            <td>{$vo.start_time|date='Y-m-d'}</td>
            <td>{$vo.end_time|date='Y-m-d'}</td>
            <td>{$vo.created_at|date='Y-m-d'}</td>
            <td>
                {if auth("admin/charge_active/edit")}
                <a data-title="编辑商品分类" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}
                {if auth("admin/charge_active/forbid")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
                {/if}
                {if auth("admin/charge_active/resume")}
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
